home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Belgian Amiga Club - ADF Collection
/
BS1 part 41.zip
/
BS1 part 41
/
Devpac 2.12 disk 1.adf
/
examples
/
demo.s
next >
Wrap
Text File
|
1989-02-06
|
2KB
|
62 lines
opt l-,c+,d+ nolink,case dependant,debug
* this source code (C) HiSoft 1987 All Rights Reserved
* a simple demo program to print a message on the screen then quit
* it uses the DOS and EXEC libraries.
************************ IMPORTANT *****************************
* the Tutorial as listed in the manual is no longer completely *
* valid. Page 12, 3rd paragraph says 'the assembly worked this *
* time' when, in fact, it will give the message 'odd address'. *
* This error should be ignored for the purpose of the tutorial *
************************ IMPORTANT *****************************
incdir ":include/" where to look
include exec/exec_lib.i I want to call EXEC
include libraries/dos_lib.i and DOS
include libraries/dos.i
* start by opening the DOS library
start move.l dosname,a1
moveq #0,d0 any version
CALLEXEC OpenLibrary
tst.l d0
beq quit_fast quit if cant
move.l d0,_DOSBase save pointer
* now find our output handle
CALLDOS Output
move.l d0,d4 d4=output handle
* and print a message
move.l d4,d1 file handle
move.l #string,d2 address of message
moveq #stringlen,d3 length
CALLDOS Write and send it
* dont close the output handle otherwise the CLI bombs!
* finished so close DOS library
mov.l _DOSBase,a1
CALLEXEC CloseLibrary
quit_fast
rts and finish
_DOSBase dc.l 0 space for pointer
* strings here
string dc.b 'A Program written with HiSoft''s Devpac Amiga',10
stringlen equ *-string
* this defines the name of the DOS library
dosname DOSNAME
even